-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Verify the sender of Rollcall create/open/close #1778
Conversation
Pull reviewers statsStats of the last 30 days for popstellar:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good for me
be1-go/channel/lao/lao.go
Outdated
func (c *Channel) checkIsFromOrganizer(msg message.Message) error { | ||
senderBuf, err := base64.URLEncoding.DecodeString(msg.Sender) | ||
if err != nil { | ||
return xerrors.Errorf(keyDecodeError, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why this is built using xerrors.Errorf
not as an amswer.NewErrorf
like the other errors returned ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was because this function was created using some existing code.
After reading answer/error.go, I just found that there are some functions with the error code already inside,
such as answer.NewInvalidMessageFieldError
and answer.NewAccessDeniedError
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job ! The fix looks good to me. I just have a small question.
Quality Gate passed for 'PoP - PoPCHA-Web-Client'Issues Measures |
Quality Gate passed for 'PoP - Be2-Scala'Issues Measures |
Quality Gate passed for 'PoP - Be1-Go'Issues Measures |
Quality Gate passed for 'PoP - Fe1-Web'Issues Measures |
Quality Gate passed for 'PoP - Fe2-Android'Issues Measures |
closes #1777
There was no verification that Rollcall create/open/close were only accepted from an organizer.
If theses messages were send by anyone, the go backend was accepting them.
This PR add a verification for each of theses messages and deny them if it was not send by an organizer.
An helper function was made using the existing code of the election#setup verificaiton.